﻿@{

    Layout = null;

    List<YQGL.Model.DM_QYBB> YBQYBBList = ViewData["YBQYBBList"] == null ? new List<YQGL.Model.DM_QYBB>() : ViewData["YBQYBBList"] as List<YQGL.Model.DM_QYBB>;

    List<YQGL.Model.DM_QYBB> JBQYBBList = ViewData["JBQYBBList"] == null ? new List<YQGL.Model.DM_QYBB>() : ViewData["JBQYBBList"] as List<YQGL.Model.DM_QYBB>;


    List<YQGL.Model.DM_QYBB> NBQYBBList = ViewData["NBQYBBList"] == null ? new List<YQGL.Model.DM_QYBB>() : ViewData["NBQYBBList"] as List<YQGL.Model.DM_QYBB>;

    List<YQGL.Model.DM_QYBB> FJQYBBList = ViewData["FJQYBBList"] == null ? new List<YQGL.Model.DM_QYBB>() : ViewData["FJQYBBList"] as List<YQGL.Model.DM_QYBB>;


}
@model DateTime
@helper GenerateQYBB(List<YQGL.Model.DM_QYBB> itemList, string LableType, string lx)
{
    List<YQGL.Model.SB_QYBB> SBQYBBList = ViewData["SBQYBBList"] == null ? new List<YQGL.Model.SB_QYBB>() : ViewData["SBQYBBList"] as List<YQGL.Model.SB_QYBB>;
    <div style="padding:0px 0px 0px 0px;">
        <fieldset>
            <legend class="heading" style="font-size:13px;margin-bottom:8px;padding-bottom:8px;">
                <h1 class="label @Html.Raw(LableType)" style="font-size:16px;font-weight:normal;">@lx</h1>&nbsp; 所属日期：@GetStartAndEndTime(lx)
            </legend>

            <div class="row" style="margin-top:10px;">
                <div class="form-horizontal" role="form">
                    <div class="col-lg-12">
                        <table class="table table-bordered">
                            <thead>
                                <tr>

                                    <th width="28%">指标名称</th>
                                    <th width="20%">本期数</th>



                                    <th width="15%">审核状态</th>
                                    <th width="37%">审核信息</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (YQGL.Model.DM_QYBB item in itemList)
                                {
                                    <tr>
                                        <td align="center">
                                            <label class="control-label input-sm text-center" style="text-align:center">
                                                @item.BBXM_MC
                                            </label>
                                            @Html.Hidden("BBXM_DM", item.BBXM_DM)
                                        </td>

                                       

                                            <td>
                                                <label class="control-label input-sm text-center" style="text-align:center">  @(SBQYBBList.FirstOrDefault(h => h.BBXM_DM == item.BBXM_DM & h.LC == "1").JE)</label>
</td>

                                            <td align="center">
                                                <label class="control-label input-sm text-center" style="text-align:center">@(SBQYBBList.FirstOrDefault(h => h.BBXM_DM == item.BBXM_DM & h.LC == "1").ZTDMStr)</label>

                                            </td>
                                            <td align="center">
                                                <label class="control-label input-sm text-center" style="text-align:center">@(SBQYBBList.FirstOrDefault(h => h.BBXM_DM == item.BBXM_DM & h.LC == "1").SHXX)</label>

                                            </td>
                                        
                                    </tr>
                                }

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </fieldset>
    </div>

}
@helper GetStartAndEndTime(string lx)
{
    switch (lx)
    {


        case "月报":
            {

                @(new DateTime(Model.Year, Model.Month, 1).ToString("yyyy年MM月dd日") + "至" + new DateTime(Model.Year, Model.Month, 1).AddMonths(1).AddDays(-1).ToString("yyyy年MM月dd日"))
                break;
            }
        case "季报":
            {


                if (Model.Month >= 3 & Model.Month < 6)
                {

                    @(new DateTime(Model.Year, 1, 1).ToString("yyyy年MM月dd日") + "至" + new DateTime(Model.Year, 4, 1).AddDays(-1).ToString("yyyy年MM月dd日"))

                }
                else if (Model.Month >= 6 & Model.Month < 9)
                {

                    @(new DateTime(Model.Year, 4, 1).ToString("yyyy年MM月dd日") + "至" + new DateTime(Model.Year, 7, 1).AddDays(-1).ToString("yyyy年MM月dd日"))
                }
                else if (Model.Month >= 9 & Model.Month < 12)
                {

                    @(new DateTime(Model.Year, 7, 1).ToString("yyyy年MM月dd日") + "至" + new DateTime(Model.Year, 10, 1).AddDays(-1).ToString("yyyy年MM月dd日"))


                }
                else if (Model.Month == 12)
                {
                    @(new DateTime(Model.Year, 10, 1).ToString("yyyy-MM-dd") + "至" + new DateTime(Model.Year + 1, 1, 1).AddDays(-1).ToString("yyyy-MM-dd"));

                }
                else
                {

                    @(new DateTime(Model.Year - 1, 10, 1).ToString("yyyy-MM-dd") + "至" + new DateTime(Model.Year, 1, 1).AddDays(-1).ToString("yyyy-MM-dd"));
                }



                break;
            }

        case "年报":
            {
                if (Model.Month >= 6 & Model.Month <= 12)
                {

                    @(new DateTime(Model.Year, 1, 1).ToString("yyyy年MM月dd日") + "至" + new DateTime(Model.Year + 1, 1, 1).AddDays(-1).ToString("yyyy年MM月dd日"))

                }
                else
                {

                    @(new DateTime(Model.Year - 1, 1, 1).ToString("yyyy年MM月dd日") + "至" + new DateTime(Model.Year, 1, 1).AddDays(-1).ToString("yyyy年MM月dd日"))

                }
                break;

            }

        case "附加报表":
            {
                @(new DateTime(Model.Year, Model.Month, 1).ToString("yyyy年MM月dd日") + "至" + new DateTime(Model.Year, Model.Month, 1).AddMonths(1).AddDays(-1).ToString("yyyy年MM月dd日"))

                break;
            }
        default:
            {

                @(new DateTime(Model.Year, Model.Month, 1).ToString("yyyy年MM月dd日") + "至" + new DateTime(Model.Year, Model.Month, 1).AddMonths(1).AddDays(-1).ToString("yyyy年MM月dd日"))

                break;
            }
    }

}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>企业报表</title>

    <!-- Bootstrap framework -->
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css" />
    <!-- jQuery UI theme -->
    <link rel="stylesheet" href="/lib/jquery-ui/css/Aristo/Aristo.css" />
    <!-- tooltips-->
    <link rel="stylesheet" href="/lib/jBreadcrumbs/css/BreadCrumb.css" />
    <!-- tooltips-->
    <link rel="stylesheet" href="/lib/qtip2/jquery.qtip.min.css" />
    <!-- colorbox -->
    <link rel="stylesheet" href="/lib/colorbox/colorbox.css" />
    <!-- code prettify -->
    <link rel="stylesheet" href="/lib/google-code-prettify/prettify.css" />
    <!-- sticky notifications -->
    <link rel="stylesheet" href="/lib/sticky/sticky.css" />
    <!-- aditional icons -->
    <link rel="stylesheet" href="/img/splashy/splashy.css" />
    <!-- flags -->
    <link rel="stylesheet" href="/img/flags/flags.css" />
    <!-- datatables -->
    <link rel="stylesheet" href="/lib/datatables/extras/TableTools/media/css/TableTools.css">


    <!-- main styles -->
    <link rel="stylesheet" href="/css/style.css" />
    <!-- theme color-->
    <link rel="stylesheet" href="/css/blue.css" id="link_theme" />

    <!--<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
    -->
    <!-- favicon -->
    <link rel="shortcut icon" href="/favicon.ico" />
    <link rel="stylesheet" href="/css/bootstrap-dropselect.css" />
    <!--[if lte IE 8]>
    <link rel="stylesheet" href="/css/ie.css"/>
    <![endif]-->
    <!--[if lt IE 9]>
    <script src="/js/ie/html5.js"></script>
    <script src="/js/ie/respond.min.js"></script>
    <script src="/lib/flot/excanvas.min.js"></script>
    <![endif]-->
    <script src="/js/jquery.min.js"></script>
    <script src="/js/jquery.actual.min.js"></script>
    <script src="/lib/validation/jquery.validate.js"></script>
    <script src="/bootstrap/js/bootstrap.min.js"></script>
    <script src="@Url.Content("~/Scripts/json2.js")" type="text/javascript"></script>

    <style type="text/css">
        table.table-bordered th {
            text-align: center;
        }

        table.table-bordered td {
            text-align: center;
        }
    </style>
    <script type="text/javascript">

        $(document).ready(function () {

        });

    </script>
</head>
<body>

    
        <div style="max-width:1000px;margin-left:auto;margin-right:auto">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title"><button type="button" class="btn btn-info btn-sm pull-Left" onclick=" window.history.back()" id="btnBack" name="btnBack">返回</button> &nbsp; &nbsp;企业报表查看 </h3>
                </div>
                <div class="panel-body">
                    <div class="alert alert-info" role="alert">
                        <strong>企业名称：</strong>@ViewData["Nsrmc"] 
                        <br />
                        <strong>报表所属时间：</strong> @Model.ToString("yyyy年MM月") &nbsp;&nbsp;
                        <strong> 企业分类：</strong>@ViewData["DLMC"]  &nbsp;,
                        @ViewData["LXMC"]  <span class="text-primary pull-right">当前登录用户：@ViewData["LoginID"]</span>



                    </div>
                   


                    <div style="padding:0px;margin:0px;" id="QYBBContent">
                       @if (YBQYBBList.Count > 0)
                       {
                        @GenerateQYBB(YBQYBBList, "label-primary", "月报")
                       }
                    @if (JBQYBBList.Count > 0)
                    {
                        @GenerateQYBB(JBQYBBList, "label-success", "季报")
                    }
                    @if (NBQYBBList.Count > 0)
                    {
                        @GenerateQYBB(NBQYBBList, "label-info", "年报")
                    }
                    @if (FJQYBBList.Count > 0)
                    {
                        @GenerateQYBB(FJQYBBList, "label-warning", "附加报表")



                    }




                    </div>
                </div>
            </div>
        </div>

       
</body>
</html>
